This invention relates to mapping textures onto 3D graphic objects.
The computer system illustrated in FIG. 1—which includes mouse 15, keyboard 16, CPU 17 and CRT 18—represents a hardware setup for running software that allows a user to model and/or render 3D graphic objects. Modeling and rendering of 3D graphic objects are used, for example, to generate 3D virtual scenes on the display screen of a computer system. The surface topology of a 3D object can be modeled as a set of polygons of appropriate sizes and shapes joined at their edges. The set of polygons defining the 3D object, referred to as the “model” for the 3D object, is represented by a collection of coordinates residing in a logical space (referred to as the “object space”) defined by a set of three axes, x, y and z. If the 3D object is to be displayed in wire-frame form, only the edge lines that form the polygons in the model are rendered, thus generating a skeleton-like image of the object. For example, the model of an X-29 aircraft shown in FIG. 2A consists of several hundred unfilled polygons joined together at their edges to form a wire-frame representation of the aircraft.
A more realistic rendering of the 3D object can be achieved by shading the polygons with various colors as appropriate, for example, as shown in FIG. 2B, by taking into account lighting and surface properties of the 3D object under consideration. The degree of realism or detail can be enhanced further by adding a texture to the surface of the 3D object. FIGS. 3A–3H show four different examples of before and after views of various surface textures being applied to four different 3D objects—a cube (FIGS. 3A–3B), a cylinder (FIGS. 3C–3D), a sphere (FIGS. 3E–3F) and a cone (FIGS. 3G–3H).
Applying a surface texture to a 3D object is referred to as “texture mapping” in which an image or “texture map”—a 2D array of pixel information, such as the map of Earth shown in FIG. 4—is overlaid on a 3D object's surface typically in a repeating manner, roughly similar to laying tiles on a floor. Alternatively, the texture can be stretched to cover the surface under consideration. A texture map resides in its own logical space (referred to as the “texture space”) defined by a pair of axes s and t as shown in FIG. 4. The texture space is independent of an object space in which the surface topology of a 3D object is defined.
A texture is mapped onto a 3D object by creating a mapping, or correlation, between coordinates in the object space and coordinates in the texture space. Different mapping functions can be used to apply a texture to a 3D object depending on the object designer's preferences. Many of the various different “primitives” (fundamental surface topologies) each has an associated standard mapping function. As shown in FIG. 5A, for example, the standard texture mapping function for a cube is to apply the entire texture map to each face of the cube. The standard mapping function for a cylinder is to apply the texture map to each end face of the cylinder and to wrap one instance of the entire texture map around the cylinder's circumference, as shown in FIG. 5B. Standard texture mapping functions also exist for a sphere (FIG. 5C) and a cone (FIG. 5D).
For non-primitive objects (e.g., objects having arbitrary surface topologies such as the bust of the female head shown in FIG. 6A), a standard plane mapping function typically is used to apply a texture to the surface of a 3D object. First, the 3D object's bounding box (i.e., a logical 3D box that is just big enough to encompass the 3D object) is calculated and then texture (for example, the texture map shown in FIG. 6B) is mapped to the largest face of the bounding box. In effect, plane mapping is accomplished by projecting the texture through the 3D graphic object, analogous to projecting an image from a slide projector onto a 3D physical object, as shown in FIG. 6C. These and other texture mapping techniques are discussed in Josie Wernecke, The Inventor Mentor: Programming Object-Oriented 3D Graphics with Open Inventor, Release 2, chapter 7, Addison-Wesley (1994), which is incorporated by reference.
Users can designate a texture to be applied to a 3D object by using an interactive graphical user interface (GUI) utility such as that shown in FIG. 7. The utility includes a Texture Mapper window 70 having a preview region 72 in which a preview version of the 3D object 71 being texture-mapped is displayed. A user designates a new or different texture for the 3D object by clicking the cursor on one of several different texture choices displayed in a texture palette 73. In response, a preview version of the object 71 with the selected texture applied is displayed in the preview window 72 to give the user an indication of how the texture mapped object will appear when rendered at a full level of detail.
A texture mapping utility may provide other features that allow a user to specify certain aspects of the manner in which a texture is mapped to the 3D object. Such features may allow the user to translate the texture map relative to the 3D object, to select among repeating and stretching type mapping functions, or to specify a texture repetition interval.